<template>
  <el-container class="technology-menu-wrapper">
    <div v-for="(item,index) in menuDataList " :key="index">
      <div class="menu-content" :class="indexMenu === index?'selected':''" @click="onItemClickListener(item,index)">
        {{item.name}}
      </div>
    </div>
  </el-container>
</template>

<script>
  export default {
    name: 'TechnologyMenu',
    data () {
      return {
        indexMenu: 0,
        menuDataList: [{
          name: '最新',
          type: 'Girl',
          bigType: 'Girl'
        }, {
          name: '妹纸',
          type: 'Girl',
          bigType: 'Girl'
        }, {
          name: '推荐',
          type: 'Girl',
          bigType: 'Girl'
        }, {
          name: 'Android',
          type: 'Android',
          bigType: 'GanHuo'
        }, {
          name: 'Flutter',
          type: 'Flutter',
          bigType: 'GanHuo'
        }, {
          name: 'ios',
          type: 'iOS',
          bigType: 'GanHuo'
        }, {
          name: '前端',
          type: 'frontend',
          bigType: 'GanHuo'
        }, {
          name: '后端',
          type: 'backend',
          bigType: 'GanHuo'
        }, {
          name: 'APP',
          type: 'app',
          bigType: 'GanHuo'
        }]
      }
    },
    methods: {
      onItemClickListener (item, index) {
        this.indexMenu = index
        this.$emit('menuSelectListener', item)
      }
    }
  }
</script>

<style lang="scss" ref="stylesheet/scss" scoped>
  .technology-menu-wrapper {
    width: 54.5%;
    margin: 0 auto;

    .menu-content {
      display: inline-block;
      padding: 5px 12px;
      border-radius: 5px;
      text-align: center;
      color: #8EB1C1;
      font-size: 13px;
      margin-right: 10px;

      &:focus, &:hover {
        color: #2C63FF;
        cursor: pointer;
      }

      &.selected {
        color: white;
        background-color: #2C63FF;
      }

    }
  }

</style>
